package cz.muni.fi.pv168.realestate;

import java.util.List;

/**
 * OwnershipManager interface
 * 
 * @author morty
 *
 */
public interface OwnershipManager {

	/**
	 * Assigns owner to property and vice versa
	 * 
	 * @param owner
	 * @param property
	 * @throws ServiceFailureException
	 */
	void assignOwnerToProperty(Owner owner, Property property) throws ServiceFailureException;
	
	/**
	 * Removes owner from property
	 * 
	 * @param owner
	 * @param property
	 * @throws ServiceFailureException
	 */
	void removeOwnerFromProperty(Owner owner, Property property) throws ServiceFailureException;
	
	/**
	 * Returns list of all properties in database for given owner
	 * @return list of all properties in database for given owner
	 * @throws ServiceFailureException when db operation fails
	 */
	List<Property> getPropertiesWithOwner(Owner owner) throws ServiceFailureException;
	
	/**
	 * Returns list of all owners in database for given property
	 * @return list of all owners in database for given property
	 * @throws ServiceFailureException when db operation fails
	 */
	List<Owner> getOwnersOfProperty(Property property) throws ServiceFailureException;
}
